﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UniversityHomeTask
{
    class Student
    {
        public string firstName;
        public string lastName;
        public DateTime birthDay;
        public int[] marks = new int[5];
        private static int studentsNumber;

        public void GenerateRandomStudent()
        {
            firstName = "Вася" + Student.studentsNumber;
            lastName = "Пупкин";
            Random rnd = new Random();
            birthDay = new DateTime(rnd.Next(1990, 2016), rnd.Next(1, 13), rnd.Next(1, 20));
            for (int i = 0; i < 5; i++)
            {
                marks[i] = rnd.Next(1, 101);
            }
            Student.studentsNumber++;
        }
        
        public void PrintInfo()
        {
            Console.WriteLine(firstName);
            Console.WriteLine(firstName);
            Console.WriteLine(birthDay.ToString("dd/MM/yyyy"));
            Console.WriteLine(GetAverageMarks());
        }

        public double GetAverageMarks()
        {
            return marks.Average();
        }
    }
}
